package com.itheima.consumer;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class MyConsumer {
    /**
     * 监听队列消息
     * @param msg
     */
    @RabbitListener(queues = {"myqueue"})
    public void receive(String msg){
        System.out.println("消费者接收到消息："+msg);
    }
}